package com.beiing.tianshuai.tianshuai.mine.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.IdentificationInfoBean;
import com.beiing.tianshuai.tianshuai.mine.model.IdentificationInfoModel;
import com.beiing.tianshuai.tianshuai.mine.model.IdentificationInfoModelImpl;
import com.beiing.tianshuai.tianshuai.mine.view.IdentificationInfoViewImpl;

/**
 * Created by Jinni on 2017/8/30 0030.
 */

public class IdentificationInfoPresenter extends BasePresenter implements IdentificationInfoPresenterImpl, IdentificationInfoModel.OnRequestListener{

    private IdentificationInfoViewImpl mView;
    private IdentificationInfoModelImpl mModel;

    public IdentificationInfoPresenter(IdentificationInfoViewImpl view) {
        mView = view;
        mModel = new IdentificationInfoModel(this);
    }

    @Override
    public void getIdentificationInfo(String uid, String type) {
        mView.showProgress();
        mModel.getIdentificationInfo(uid, type);
    }

    @Override
    public void onSuccess(IdentificationInfoBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onError(Throwable throwable) {
        mView.hideProgress();
        mView.onRequestFailed(throwable);
    }
}
